#ifndef PEERNODECONNSOCKET_H
#define PEERNODECONNSOCKET_H



#include <QTcpSocket>
#include <QObject>
#include <QString>


class PeerNodeConnSocket: public QTcpSocket
{
     Q_OBJECT
public:
    PeerNodeConnSocket(QObject *parent = 0);
     ~PeerNodeConnSocket();

    /// 所有的消息类型
    enum MsgKind{
        NAMEMSG = 0,      // "NM",
        METAMSG = 1,      // "MM",
        DISCONNECT = 2,   // "DC",
        SHAREMSG = 3,     // "SM",
        DELETEMSG = 4,    // "DM",
        SEARCHMSG = 5,    // "SR",
        SIGNMSG = 6,      // "GM",
        OTHERMSG = 7      // "OT",
    };

signals:
    void UpdateClients(QString, int);
    void UpdateUserName(QString);
    void UpdateMeta(QString);
    void Disconnected(int);
    void ReturnMeta(QString);
    void DeleteMeta(QString);
    void SearchMeta(QString);
    void UpdateUserInfo(QString);
protected slots:
    void DataReceived();
    void slotDisconnected();
};

#endif // PEERNODECONNSOCKET_H
